from appium import webdriver
from appium.webdriver.common.appiumby import By
from time import sleep
from zoom import *
desired_caps={}
desired_caps['platformName']='Android'
desired_caps['platfromVersion']='7'
desired_caps['devices']='127.0.0.1:62001'
desired_caps['app']=r'D:\apk\GaoDeMap.apk'
desired_caps['appActivity']='com.autonavi.map.activity.SplashActivity'
desired_caps['appPackage']='com.autonavi.minimap'
desired_caps['noResert']=True
driver=webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
sleep(1)
# 同意
driver.find_element(By.ID,'com.autonavi.minimap:id/agree').click()
# 跳过
driver.find_element(By.ID,'com.autonavi.minimap:id/skip_btn').click()
sleep(1.5)
# 允许
driver.find_element(By.ID,'com.android.packageinstaller:id/permission_allow_button').click()
# 允许
sleep(1.5)
driver.find_element(By.ID,'com.android.packageinstaller:id/permission_allow_button').click()
# 允许
sleep(1.5)
driver.find_element(By.ID,'com.android.packageinstaller:id/permission_allow_button').click()
sleep(3)
if __name__ == '__main__':
    smaller(driver)